package drds.data_propagate.binlog_event.binlog_event.load_infile_replication;

import drds.data_propagate.binlog_event.BinLogEvent;
import drds.data_propagate.binlog_event.Buffer;
import drds.data_propagate.binlog_event.binlog_event.Header;
import drds.data_propagate.binlog_event.binlog_event.binlog_management.FormatDescriptionEvent;
import lombok.Getter;
import lombok.Setter;


public final class ExecLoadEvent extends BinLogEvent {

    /* el = "execute load" */
    public static final int execute_load_event_offset = 0;
    @Setter
    @Getter
    private final long fileId;

    public ExecLoadEvent(Header header, Buffer buffer, FormatDescriptionEvent formatDescriptionEvent) {
        super(header);

        final int commonHeaderLength = formatDescriptionEvent.commonHeaderLength;
        buffer.newReadedIndex(commonHeaderLength + execute_load_event_offset);
        fileId = buffer.getNextLittleEndian32UnsignedLong(); // EL_FILE_ID_OFFSET
    }

}
